package com.RedRiver.hospitalsystem.finance_service.app.controller;

import com.RedRiver.hospitalsystem.finance_service.client.PaymethodClient;
import com.RedRiver.hospitalsystem.finance_service.client.param.PaymethodInfoClient;
import com.RedRiver.hospitalsystem.finance_service.client.param.PaymethodInfoListClient;
import com.RedRiver.hospitalsystem.finance_service.common.WoniuxyBeanCopyUtil;
import com.RedRiver.hospitalsystem.finance_service.service.PaymethodService;
import com.RedRiver.hospitalsystem.finance_service.service.info.PaymethodInfo;
import com.RedRiver.hospitalsystem.finance_service.service.info.PaymethodInfoList;
import com.RedRiver.hospitalsystem.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 龙世超
 * @since 2022-04-26
 */
@RestController
@RequestMapping("/paymethod")
@Api(tags = "缴费方式")
public class PaymethodController implements PaymethodClient {

    @Resource
    private PaymethodService paymethodService;

    //查询所有缴费方式
    @ApiOperation("//查询所有缴费方式")
    @PostMapping("/findPaymethodAll")
    public Result<PaymethodInfoListClient> findPaymethodAll() {
        PaymethodInfoList paymethodInfoList = paymethodService.findAll();
        return Result.getInstance(PaymethodInfoListClient.class).setData(
                WoniuxyBeanCopyUtil.copyone(paymethodInfoList,PaymethodInfoListClient.class));
    }
}

